﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Proggy.Web.Cms.AppHelpers
{
    public class ProggyAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Proggy";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            // get namespaces
            var namespaces = BackEndSections.Sections.Select(s => s.ControllersNamespace).ToArray();

            context.MapRoute(
                "Proggy_default",
                "Proggy/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces
            );
        }
    }
}
